<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: huasheng
  Date: 2023/11/24
  Time: 17:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<!-- 修改对话框 -->
<div class="modal fade" id="modal_dept_edit" role="dialog" aria-labelledby="modal_dept_edit" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <form id="form_dept" method="post" action="saveStu">
                    <input type="hidden" name="id" id="hidden_txt_dept_id" value="${stu.id}"/>
                    <table style="border-collapse:separate; border-spacing:0px 10px;">
                        <tr>
                            <td>姓名：</td>
                            <td><input type="text" id="name" name="name" value="${stu.name}"
                                       class="form-control" aria-required="true" required/>
                                <span style="color: red;" id="s"></span></td>
                        </tr>
                        <tr>
                            <td>年龄：</td>
                            <td><input type="text" id="age" name="age" value="${stu.age}"
                                       class="form-control" aria-required="true" required/></td>
                        </tr>
                        <tr>
                            <td>性别：</td>
                            <td><input type="radio" id="s1" name="sex" value="男" <c:if test="${stu.sex=='男'}">checked</c:if>/>男

                                <input type="radio" id="s2" name="sex" value="女" <c:if test="${stu.sex=='女'}">checked</c:if>/>女</td>
                        </tr>

                        <tr>
                            <td>爱好：</td>
                            <td><input type="checkbox" id="a" name="hobby" value="看书" <c:if test="${stu.hobby.contains('看书')}">checked</c:if>/>看书
                                <input type="checkbox" id="b" name="hobby" value="旅游" <c:if test="${stu.hobby.contains('旅游')}">checked</c:if>/>旅游
                                <input type="checkbox" id="c" name="hobby" value="篮球" <c:if test="${stu.hobby.contains('篮球')}">checked</c:if>/>篮球
                            </td>
                        </tr>

                        <tr>
                            <td>专业：</td>
                            <td> <select name="mid">
                                <option value="">--请选择--</option>
                                <c:forEach items="${majorList}" var="m">
                                    <option value="${m.id}" <c:if test="${m.id==stu.mid}">selected</c:if>>${m.mname}</option>
                                </c:forEach>
                            </select>
                            </td>
                        </tr>

                        <tr>
                            <td>老师：</td>
                            <td> <select name="tid">
                                <option value="">--请选择--</option>
                                <c:forEach items="${teacherList}" var="t">
                                    <option value="${t.id}" <c:if test="${t.id==stu.tid}">selected</c:if>>${t.tname}</option>
                                </c:forEach>
                            </select>
                            </td>
                        </tr>

                        <tr>
                            <td> 生日：</td>
                            <td><input type="date" name="birthday" value="<fmt:formatDate pattern="yyyy-MM-dd" value="${stu.birthday}"></fmt:formatDate>"></td>
                        </tr>

                    </table>

                    <div class="modal-footer">
                        <button type="submit" class="btn btn-primary" id="submit_form_dept_btn">保存</button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    </div>
                </form>

            </div>

        </div>

    </div>

</div>

</body>
</html>
